﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using UCOLOR.Helpers;
using UCOLOR.Model;
namespace UCOLOR.View
{
    /// <summary>
    /// HomeView.xaml 的交互逻辑
    /// </summary>
    public partial class HomeView_New :  ModuleView 
    {
        public HomeView_New()
        {
            InitializeComponent();
           // ShowModudel();
        }

        public void ShowDir()
        {
            //MainWindow main = (this.DataContext as MainWindow);
            //if (main.ViewList["DirView"] != null)
            //{
            //    ShowMoudel(main, "DirView");
            //}
            //else
            //{
            //    DirView dir = new DirView("HOME");
            //    ShowModudel("DirListView", new DirListView());
            //    dir.InitTopNav("HOME");
            //    main.ViewList.Add("DirView", dir);
            //    dir.DataContext = (this.DataContext as MainWindow);
            //    (this.DataContext as MainWindow).Content = dir;

            //}
        }

        private void Tile_Click(object sender, EventArgs e)
        {
            ShowDir();
        }

        private void TileLayoutControl_TileClick(object sender, DevExpress.Xpf.LayoutControl.TileClickEventArgs e)
        {

        }

        private void Tile_Click_1(object sender, EventArgs e)
        {
            ShowDir();
        }

        void ShowMoudel(MainWindow main, string Key)
        {
            main.Content = main.ViewList[Key];
        }

        public  void ShowModudel()
        {
            //HomeDetaiView _view = new HomeDetaiView();
            //var  data = DataHelper.getCategorys().Where(p => p.ID == 2).ToList();
            //_view.data = data;
            //_view.part_data = DataHelper.GetPartProductCode();
            //_view.DirList.ItemsSource = _view.part_data;
            //_view.TopProduct.ItemsSource = _view.data;
            //_view.TopCategory.ItemsSource = DataHelper.getCategorys("HOME");
            //this.DataCenter.ColumnDefinitions.Clear();
            //this.DataCenter.Children.Add(_view);
            //_view.SetValue(Grid.ColumnProperty, 0);
        }
    }
}
